<!DOCTYPE html>
<html data-ng-controller="mainCtrl">
<head lang="zh">
    <meta charset="UTF-8">
    ${require('mypublic/inc/head.html')}
</head>
<body>
${require('mypublic/inc/seajs.html')}
${require('mypublic/inc/top.html')}
${require('@yunke/core/html/server_time.html')}
<div class="layout">
    <!-- 容器 [[-->
    <div class="container">
        <div class="wrap clearfix">
            <div class="pt10">
                ${require('mypublic/inc/left_side.html')}
            </div>
            <div class="content" id="js_page_content">


                <div>
                    <div>

                        <div class="table-header clearfix ">
                            <span class="fl lh30 f14 ">目录编辑</span>
                        </div>

                        <div id="js_error_msg"></div>

                        <iframe name="js_post_target_iframe" style="display: none;"></iframe>

                        <form class="form-horizontal" action="{{action}}"
                              method="post" enctype="multipart/form-data" autocomplete="off"
                              target="js_post_target_iframe"
                        >

                            <div class="form-group mt10">
                                <span class="col-sm-3 control-label ml15">
                                    <label for="direntity-parent_id">顶级目录</label>
                                </span>
                                <div class="col-sm-5">
                                    <select id="direntity-parent_id" class="form-control" name="DirEntity[parent_id]">
                                        <option
                                                ng-repeat="(key,item) in data.dirs"
                                                value="{{key}}"
                                                ng-selected="{{data.model.id===key}}"
                                        >
                                            {{item}}
                                        </option>
                                    </select>
                                </div>
                            </div>

                            <div class="form-group mt10">
                                <span class="col-sm-3 control-label ml15">
                                    <label for="direntity-code">编码</label>
                                </span>
                                <div class="col-sm-5">
                                    <select id="direntity-code" class="form-control" name="DirEntity[code]">
                                        <option
                                                ng-repeat="(key,item) in data.charsets"
                                                value="{{key}}"
                                                ng-selected="{{data.model.id===key}}"
                                        >
                                            {{item}}
                                        </option>
                                    </select>
                                    <span class="error c-redlh30">非专业人士，请勿随意修改</span>
                                </div>
                            </div>

                            <div class="form-group mt10">
                                <span class="col-sm-3 control-label ml15">
                                    <label for="direntity-name">名称</label>
                                </span>
                                <div class="col-sm-7">
                                    <input type="text" id="direntity-name" class="form-control" name="DirEntity[name]"
                                           ng-model="data.model.name">
                                </div>
                            </div>

                            <div class="form-group mt10">
                                <span class="col-sm-3 control-label ml15">
                                    <label for="direntity-short_desc">简要描述</label>
                                </span>
                                <div class="col-sm-11">
                                    <input type="text" id="direntity-short_desc" class="form-control"
                                           name="DirEntity[short_desc]" ng-model="data.model.short_desc">
                                </div>
                            </div>

                            <div class="form-group mt10">
                                <span class="col-sm-3 control-label ml15">
                                    <label for="direntity-img_url">图片地址</label>
                                </span>
                                <div class="col-sm-11">
                                    <input type="text" id="direntity-img_url" class="form-control"
                                           name="DirEntity[img_url]" ng-model="data.model.img_url">
                                </div>
                            </div>

                            <div class="form-group mt10">
                                <span class="col-sm-3 control-label ml15">
                                    <label for="direntity-url">跳转地址</label>
                                </span>
                                <div class="col-sm-11">
                                    <input type="text" id="direntity-url" class="form-control" name="DirEntity[url]"
                                           ng-model="data.model.url">
                                </div>
                            </div>

                            <div class="form-group mt10">
                                <span class="col-sm-3 control-label ml15">
                                    <label for="direntity-sort">排序</label>
                                </span>
                                <div class="col-sm-2">
                                    <input type="text" id="direntity-sort" class="form-control" name="DirEntity[sort]"
                                           ng-model="data.model.sort">
                                </div>
                            </div>
                            <div class="form-group mt10">
                                <span class="col-sm-3 control-label ml15">
                                    <label for="direntity-status">发布状态</label>
                                </span>
                                <div class="col-sm-2">
                                    <input type="hidden" name="DirEntity[status]" ng-model="data.model.status">
                                    <label>
                                        <input
                                                type="checkbox" id="direntity-status"
                                                ng-model="statusChecked"
                                        >
                                    </label>
                                </div>
                            </div>

                            <div class="form-group mt10">
                                <span class="col-sm-3 control-label ml15">
                                    <label for="direntity-external_display">对外显示</label>
                                </span>
                                <div class="col-sm-2">
                                    <input type="hidden" name="DirEntity[external_display]"
                                           ng-model="data.model.external_display">
                                    <label>
                                        <input
                                                type="checkbox"
                                                id="direntity-external_display"
                                                ng-model="externalDisplayChecked">
                                    </label>
                                </div>
                            </div>

                            <input type="hidden" name="key" ng-value="key">

                            <div class="form-group">
                                <div class="ml35 mt15">
                                    <button type="submit" class="btn btn-default ng-scope"
                                            ng-if="userAuthList.indexOf('0711') !== -1"
                                            ng-click="beforeSubmit()">
                                        保存
                                    </button>
                                    <a class="btn btn-yellow" href="/official/dir_list/index.html">返回列表</a>
                                </div>
                            </div>
                        </form>
                    </div>
                </div>


            </div>
        </div>
    </div>
    <!-- 容器 ]]-->
</div>
</body>
${require('@yunke/core/public_menu/footer.html')}
<script type="text/javascript" src="./index.js"></script>
</html>
